FROM registry.kuick.cn/cc/java-web

RUN apt-get update
RUN apt-get -y install mysql-server

RUN /etc/init.d/mysqld start &&\
	mysql -e "grant all privileges on *.* to 'root'@'%' identified by 'letmein';" &&\
	mysql -e "grant all privileges on *.* to 'root'@'localhost' identified by 'letmein';" &&\
	mysql -u root -pletmein -e "show databases;"

EXPOSE 3306

CMD ["/usr/bin/mysql_safe"]